<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    $bll_o = new Bll_Hr_OutInterface();
?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>
<div class="container">
    <h3>岗位/薪资异动办理</h3>
    <div>
        <div class="d1">
            <span>姓名：<?=htmlspecialchars($transfer_info['before_info'][0])?></span>
            <span>部门：<?=htmlspecialchars($transfer_info['before_info'][2].$transfer_info['before_info'][3].$transfer_info['before_info'][4])?></span>
            <span>职位：<?=htmlspecialchars($transfer_info['before_info'][5])?>-<?=$transfer_info['before_info'][7]?></span>
            <span>入职时间：<?=date('Y-m-d',strtotime($transfer_info['before_info'][6]))?></span>
        </div>
        <ul class="u1">
            <li style="height: auto;">
                <label class="lbock">薪资异动原因</label>
                <span class="rblock">&nbsp;
                    <?php if($transfer_info["salary_type"]) echo Const_Flow::salary_type($transfer_info["salary_type"])?>
                    <?php if($transfer_info["salary_reason"]) echo '('.htmlspecialchars($transfer_info["salary_reason"]).')';?>
                </span>
            </li>
            <li style="height: auto;">
                <label>岗位异动类别</label>
                <?php if($transfer_info["transfer_reason"]):?>
                <span class="rblock">&nbsp;
                    <?php if($transfer_info["transfer_type"]) echo Const_Flow::transfer_type($transfer_info["transfer_type"])?>
                    <?php if($transfer_info["transfer_reason"]) echo '('.htmlspecialchars($transfer_info["transfer_reason"]).')';?>
                </span>
                <?php endif;?>
                <?php if($transfer_info['after_info'][0]){?>
                <span class="rblock">申请部门：<?=trim($transfer_info['after_info'][1])?></span>
                <span class="rblock">申请职位：<?=trim($transfer_info['after_info'][0])?></span>
                <?php }?>
                <?php if($transfer_info['super_name']){?>
                <?php list($name,)=explode('(',$transfer_info['super_name']);?>
                <span class="rblock">直属主管：<?=trim($name)?></span>
                <?php }?>
            </li>
            <li style="height: auto;">
                <label>调整职级</label><span><?php if($transfer_info['p_level'][0]) echo 'P'.(($transfer_info['p_level']==99) ? 0 :$transfer_info['p_level'])?> <?php if($transfer_info['m_level'][0]) echo 'M'.(($transfer_info['m_level']==99)? 0 :$transfer_info['m_level'])?></span>
            </li>
            <li>
                <label>建议生效日期</label><span><?=Util_Tools::format_date($transfer_info['plan_date'])?></span>
            </li>
        </ul>
    </div>

    <form method="post" action="" id="form1">
        <ul class="f1u1">
            <li class="li1"><label>原主管审批</label></li>
            <li>
                <span><i class="i2">确认生效日期：</i><input disabled="disabled" name="effective_date" type="text" class="datepicker" value="<?=Util_Tools::format_date($transfer_info['effective_date'])?>"/></span>
                <span class="sp1"><input disabled="disabled" type="radio" value="1" name="old_approve" checked />批准该申请</span>
                <span class="sp1"><input disabled="disabled" type="radio" value="2" name="old_approve"<?php if($transfer_info['old_approve'] == 2) echo 'checked';?> />驳回该申请</span>
                <span class="sp2"><i>原因：</i><textarea disabled="disabled" name="old_reason" rows="" cols="" maxlength="90"><?=$transfer_info['old_reason']?></textarea></span>
                <!--<input disabled="disabled" type="">-->
            </li>
        </ul>
        <ul class="f1u1">
            <li class="li1"><label>跨级主管审批</label></li>
            <li>
                <span class="sp1"><input disabled="disabled" value="1" type="radio" name="new_approve" checked />批准该申请</span>
                <span class="sp1"><input disabled="disabled" value="2" type="radio" name="new_approve" <?php if($transfer_info['new_approve'] == 2) echo 'checked';?> />驳回该申请</span>
                <span class="sp2"><i>原因：</i><textarea disabled="disabled" name="new_reason" rows="" cols="" maxlength="90"><?=$transfer_info['new_reason']?></textarea></span>
            </li>
        </ul>

        <ul class="f1u1">
            <li class="li1"><label>HR审批</label></li>
            <li>
                <span class="sp1">
                    <input disabled="disabled" value="1" class="rad" type="radio" name="hr_approve" checked />批准该申请
                    <span>调整职级：
                        <select disabled="disabled" name="hr_p_level">
                            <option value="0">P级</option>
                            <?php foreach($p_level as $row){?>
                                <option value="<?=$row['id']?>" <?php if($transfer_info['hr_p_level'] == $row['id'])echo 'selected';?>><?=$row['degree']?></option>
                            <?php }?>
                        </select>
                        <select disabled="disabled" name="hr_m_level">
                            <option value="0">M级</option>
                            <?php foreach($m_level as $row){?>
                                <option value="<?=$row['id']?>" <?php if($transfer_info['hr_m_level'] == $row['id'])echo 'selected';?>><?=$row['degree']?></option>
                            <?php }?>
                        </select>
                    </span>
                </span>
                <span class="sp1"><input disabled="disabled" value="2" type="radio" name="hr_approve" <?php if($transfer_info['hr_approve'] == 2) echo 'checked';?> />驳回该申请</span>
                <span class="sp2"><i>原因：</i><textarea disabled="disabled" name="hr_reason" rows="" cols="" maxlength="90" ><?=$transfer_info['hr_reason']?></textarea></span>
                <span class="sp3">
                <i class="i1">调整薪资：</i><input disabled="disabled" value="1" type="radio" name="hr_change_salary" checked class="rdd"/>是 <input value="<?=$bll_o->decrypt_value($transfer_info['hr_new_salary'])?>" disabled="disabled" name="hr_new_salary" type="text"  placeholder="金额："/>
                </span>
                <span class="sp1"><input disabled="disabled" type="radio" value="2" name="hr_change_salary" <?php if($transfer_info['hr_change_salary'] == 2) echo 'checked';?> />否</span>
            </li>
        </ul>

        <ul class="f1u1">
            <li class="li1"><label>HRD审批</label></li>
            <li>
                <span class="sp1">
                    <input disabled="disabled" value="1" class="rad" type="radio" name="hrd_approve" checked />批准该申请
                    <span>调整职级：
                        <select disabled="disabled" name="hrd_p_level">
                            <option value="0">P级</option>
                            <?php foreach($p_level as $row){?>
                                <option value="<?=$row['id']?>" <?php if($transfer_info['hrd_p_level'] == $row['id'])echo 'selected';?>><?=$row['degree']?></option>
                            <?php }?>
                        </select>
                        <select disabled="disabled" name="hrd_m_level">
                            <option value="0">M级</option>
                            <?php foreach($m_level as $row){?>
                                <option value="<?=$row['id']?>" <?php if($transfer_info['hrd_m_level'] == $row['id'])echo 'selected';?>><?=$row['degree']?></option>
                            <?php }?>
                        </select>
                    </span>
                </span>
                <span class="sp1"><input disabled="disabled" value="2" type="radio" name="hrd_approve" <?php if($transfer_info['hrd_approve'] == 2) echo 'checked';?> />驳回该申请</span>
                <span class="sp2"><i>原因：</i><textarea disabled="disabled" name="hrd_reason" rows="" cols="" maxlength="90" ><?=$transfer_info['hrd_reason']?></textarea></span>
                <span class="sp3">
                <i class="i1">调整薪资：</i><input disabled="disabled" value="1" type="radio" name="hrd_change_salary" checked class="rdd"/>是 <input disabled="disabled" name="hrd_new_salary" type="text" value="<?=$bll_o->decrypt_value($transfer_info['hrd_new_salary'])?>" placeholder="金额："/>
                </span>
                <span class="sp1"><input disabled="disabled" type="radio" value="2" name="hrd_change_salary" <?php if($transfer_info['hrd_change_salary'] == 2) echo 'checked';?> />否</span>
            </li>
        </ul>
<?php if($transfer_info['flow_type'] == Const_Flow::FLOW_TYPE_TRANSFER){?>
        <ul class="f1u1">
            <li class="li1"><label>行政部</label></li>
            <li>
                <span class="sp3"><i class="i1">换座位：</i><input disabled="disabled" value="1" type="radio" name="admin_change_seat" class="rdd" checked />是  <input disabled="disabled" name="admin_new_seat" value="<?=htmlspecialchars($transfer_info['admin_new_seat'])?>" type="text" placeholder="请输入座位..."/></span>
                <span class="sp1"><input disabled="disabled" type="radio" value="2" name="admin_change_seat" <?php if($transfer_info['admin_change_seat'] == 2) echo 'checked';?> />否</span>

                <span class="sp3"><i class="i1">换电脑：</i><input disabled="disabled" value="1" type="radio" name="admin_change_computer" class="rdd" checked />是
                    <select disabled="disabled" name="admin_new_computer">
                    <option value="0">选择电脑</option>
                    <?php foreach($computer_type as $index=>$row){?>
                        <option value="<?=$index?>" <?php if($transfer_info['admin_new_computer'] == $index) echo ' selected="selected"';?>><?=$row?></option>
                    <?php }?>
                    </select>
                </span>
                <span class="sp1"><input disabled="disabled" type="radio" value="2" name="admin_change_computer" <?php if($transfer_info['admin_change_computer'] == 2) echo 'checked';?> />否</span>

                <span class="sp3"><i class="i1">备注：</i><input disabled="disabled" name="admin_remark" type="text" value="<?=htmlspecialchars($transfer_info['admin_remark'])?>"/></span>

            </li>
        </ul>

        <ul class="f1u1">
            <li class="li1"><label>IT部</label></li>
            <li>
                <span class="sp3"><i class="i1">更改权限：</i><input disabled="disabled" value="1" type="radio" name="it_change_power" class="rdd" checked />是
                <input disabled="disabled" value="2" type="radio" name="it_change_power" <?php if($transfer_info['it_change_power'] == 2) echo 'checked';?> />否 </span>
                <span class="sp3"><i class="i1">电脑已更换：</i><input disabled="disabled" value="1" type="radio" name="it_change_computer" class="rdd" checked />是 <input disabled="disabled" type="radio" value="2" name="it_change_computer" <?php if($transfer_info['it_change_computer'] == 2) echo 'checked';?> />否 </span>
                <span class="sp3"><i class="i2" style=" margin-left: -5px;">收回原有电脑：</i><input disabled="disabled" value="1" type="radio" name="it_revoke_computer" class="rdd" checked />是 <input disabled="disabled" value="2" type="radio" name="it_revoke_computer" <?php if($transfer_info['it_revoke_computer'] == 2) echo 'checked';?> />否 </span>
                <span class="sp3"><i class="i1">安装分机：</i><input disabled="disabled" value="1" type="radio" name="it_change_phone" class="rdd" checked />是 <input disabled="disabled" value="2" type="radio" name="it_change_phone" <?php if($transfer_info['it_change_phone'] == 2) echo 'checked';?> />否 （办公电话：<input disabled="disabled" name="it_new_phone" type="text" size="6" placeholder="如:021-88888888" value="<?=htmlspecialchars($transfer_info['it_new_phone'])?>"/> 分机：<input disabled="disabled" name="it_new_phone_ex" type="text" size="2" value="<?=htmlspecialchars($transfer_info['it_new_phone_ex'])?>"/>）</span>
                <span class="sp3"><i class="i1" style=" margin-left: -2px;">备注：</i><input disabled="disabled" name="it_remark" type="text" value="<?=htmlspecialchars($transfer_info['it_remark'])?>"/></span>

            </li>
        </ul>
<?php }?>

        <ul class="f1u1 last">
            <li class="li1"><label>HR</label></li>
            <li>
                <span class="sp3"><i class="i3">确认以上信息：</i><input disabled="disabled" value="1" type="radio" name="hr_approve_all" class="rdd" checked />生效 <input disabled="disabled" value="2" type="radio" name="hr_approve_all" <?php if($transfer_info['hr_approve_all'] == 2) echo 'checked';?> />撤销 </span>
                <span class="sp3"><i class="i1" style=" margin-left: -2px;">备注：</i><input disabled="disabled" name="hr_approve_remark" type="text" value="<?=htmlspecialchars($transfer_info['hr_approve_remark'])?>"/></span>

            </li>
        </ul>

        <ul class="f1u1">
            <li class="lilast">
            <?php if($allow_names){?>
                <input type="submit" class="sub" value=""/>
            <?php }elseif($print_flag){?>
                <a href="<?=Flow_Urls::flow_print().'?do=transfer&id='.$transfer_info['flow_id']?>" target="_blank" class="button" >打印预览</a>
            <?php }?>
            </li>
        </ul>

    </form>
</div>
<div class="footer">
<?php $this->script_block_begin(); ?>
<script type="text/javascript">
//用JS打开允许操作的input
function open_allow_names(){
    var allow_names = <?=json_encode($allow_names)?>;
    $(allow_names).each(function(index,value){
        $("[name='"+value+"']").attr("disabled",false);
        $(".datepicker").datepicker({ dateFormat: "yy-mm-dd" });
    });
}
open_allow_names();
</script>
<?php $this->script_block_end(); ?>